package org.jeecgframework.tag.core.plugin.vo;

import javax.annotation.Nonnull;

import org.jeecgframework.tag.core.base.BaseTag;

/**
 * 自动完成标签
 * 
 * @author JueYue
 * @date 2014年12月2日 下午10=17=40
 */
public class AutocompleteTagModel extends BaseTag {

    protected static final long serialVersionUID  = 1L;
    /**
     * 控件名称
     */
    protected String            name;
    /**
     *  数据源
     */
    protected String            dataSource        = "commonController.do?getAutoList";
    /**
     * 提示显示的字段
     */
    @Nonnull
    protected String            labelField;
    /**
     * 查询关键字字段
     */
    @Nonnull
    protected String            searchField;
    /**
     * 传递后台的字段
     */
    @Nonnull
    protected String            valueField        = "id";
    /**
     *  实体名称
     */
    protected String            entityName;
    /**
     *  选中后调用的函数
     */
    protected String            selectfun;
    /**
     *  传入显示值
     */
    protected String            label;
    /**
     * 传入隐藏域值
     */
    protected String            value;
    /**
     *  数据验证类型
     */
    protected String            datatype;
    /**
     *  数据为空时验证
     */
    protected String            nullmsg           = "";
    /**
     *  数据格式不对时验证
     */
    protected String            errormsg          = "输入格式不对";
    /**
     *  没有选择下拉项目的处理函数
     */
    protected String            closefun;
    /**
     * 格式化数据
     */
    protected String            parse;
    /**
     * 处理函数
     */
    protected String            result;
    /**
     * 最小匹配字符
     */
    protected Integer           minChars          = 1;
    /**
     * 延迟时间
     */
    protected Integer           delay             = 400;
    /**
     * 大小写敏感,使用缓存时比较重要
     */
    protected boolean           matchCase         = false;
    /**
     * autoComplete可不可以使用对服务器查询的缓存
     */
    protected boolean           matchSubset       = true;
    /**
     * 决定比较时是否要在字符串内部查看匹配,如ba是否与foo bar中的ba匹配.使用缓存时比较重要.不要和autofill混用
     */
    protected boolean           matchContains     = false;
    /**
     * 缓存长度
     */
    protected Integer           cacheLength       = 10;
    /**
     * autoComplete下拉显示项目的个数
     */
    protected Integer           max               = 10;
    /**
     * 如果设置为true,autoComplete只会允许匹配的结果出现在输入框,所有当用户输入的是非法字符时将会得不到下拉框
     */
    protected boolean           mustMatch         = false;
    /**
     * 如果设置成true,在用户键入tab或return键时autoComplete下拉列表的第一个值将被自动选择,尽管它没被手工选中(用键盘或鼠标).
     * 当然如果用户选中某个项目,那么就用用户选中的值
     */
    protected boolean           selectFirst       = true;
    /**
     * 格式化输出对象
     */
    protected String            formatItem;
    /**
     * 对每一行数据使用此函数格式化需要查询的数据格式. 返回值是给内部搜索算法使用的
     */
    protected String            formatMatch       = null;
    /**
     * 要不要在用户选择时自动将用户当前鼠标所在的值填入到input框
     */
    protected boolean           autoFill          = false;
    /**
     * 下拉宽度
     */
    protected Integer           width             = 200;
    /**
     * 是否允许输入多个值即多次使用autoComplete以输入多个值
     */
    protected boolean           multiple          = false;
    /**
     * 如果是多选时,用来分开各个选择的字符
     */
    protected String            multipleSeparator = "; ";

    protected String            highlight;
    /**
     * 当结果集大于默认高度时是否使用卷轴显示
     */
    protected boolean           scroll            = true;
    /**
     * 自动完成提示的卷轴高度用像素大小表示
     */
    protected Integer           scrollHeight      = 180;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public String getLabelField() {
        return labelField;
    }

    public void setLabelField(String labelField) {
        this.labelField = labelField;
    }

    public String getSearchField() {
        return searchField;
    }

    public void setSearchField(String searchField) {
        this.searchField = searchField;
    }

    public String getValueField() {
        return valueField;
    }

    public void setValueField(String valueField) {
        this.valueField = valueField;
    }

    public String getEntityName() {
        return entityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    public String getSelectfun() {
        return selectfun;
    }

    public void setSelectfun(String selectfun) {
        this.selectfun = selectfun;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDatatype() {
        return datatype;
    }

    public void setDatatype(String datatype) {
        this.datatype = datatype;
    }

    public String getNullmsg() {
        return nullmsg;
    }

    public void setNullmsg(String nullmsg) {
        this.nullmsg = nullmsg;
    }

    public String getErrormsg() {
        return errormsg;
    }

    public void setErrormsg(String errormsg) {
        this.errormsg = errormsg;
    }

    public String getClosefun() {
        return closefun;
    }

    public void setClosefun(String closefun) {
        this.closefun = closefun;
    }

    public String getParse() {
        return parse;
    }

    public void setParse(String parse) {
        this.parse = parse;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Integer getMinChars() {
        return minChars;
    }

    public void setMinChars(Integer minChars) {
        this.minChars = minChars;
    }

    public Integer getDelay() {
        return delay;
    }

    public void setDelay(Integer delay) {
        this.delay = delay;
    }

    public boolean isMatchCase() {
        return matchCase;
    }

    public void setMatchCase(boolean matchCase) {
        this.matchCase = matchCase;
    }

    public boolean isMatchSubset() {
        return matchSubset;
    }

    public void setMatchSubset(boolean matchSubset) {
        this.matchSubset = matchSubset;
    }

    public boolean isMatchContains() {
        return matchContains;
    }

    public void setMatchContains(boolean matchContains) {
        this.matchContains = matchContains;
    }

    public Integer getCacheLength() {
        return cacheLength;
    }

    public void setCacheLength(Integer cacheLength) {
        this.cacheLength = cacheLength;
    }

    public Integer getMax() {
        return max;
    }

    public void setMax(Integer max) {
        this.max = max;
    }

    public boolean isMustMatch() {
        return mustMatch;
    }

    public void setMustMatch(boolean mustMatch) {
        this.mustMatch = mustMatch;
    }

    public boolean isSelectFirst() {
        return selectFirst;
    }

    public void setSelectFirst(boolean selectFirst) {
        this.selectFirst = selectFirst;
    }

    public String getFormatItem() {
        return formatItem;
    }

    public void setFormatItem(String formatItem) {
        this.formatItem = formatItem;
    }

    public String getFormatMatch() {
        return formatMatch;
    }

    public void setFormatMatch(String formatMatch) {
        this.formatMatch = formatMatch;
    }

    public boolean isAutoFill() {
        return autoFill;
    }

    public void setAutoFill(boolean autoFill) {
        this.autoFill = autoFill;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public boolean isMultiple() {
        return multiple;
    }

    public void setMultiple(boolean multiple) {
        this.multiple = multiple;
    }

    public String getMultipleSeparator() {
        return multipleSeparator;
    }

    public void setMultipleSeparator(String multipleSeparator) {
        this.multipleSeparator = multipleSeparator;
    }

    public String getHighlight() {
        return highlight;
    }

    public void setHighlight(String highlight) {
        this.highlight = highlight;
    }

    public boolean isScroll() {
        return scroll;
    }

    public void setScroll(boolean scroll) {
        this.scroll = scroll;
    }

    public Integer getScrollHeight() {
        return scrollHeight;
    }

    public void setScrollHeight(Integer scrollHeight) {
        this.scrollHeight = scrollHeight;
    }

}
